    //
//  OptionViewController.m
//  mtt
//
//  Created by Gerfried Mikusch on 19.05.10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//





#import "OptionViewController.h"
#import "HelpViewController.h"
#import "mttImage.h"
#import "optionViewBackground.h"



@implementation OptionViewController

@synthesize imagePicker, delegate;


#pragma mark -
#pragma mark Actions

- (IBAction)pushLibrary:(UIButton *)sender {
	
	//TODO: Bilder im ImagePicker mit Alphakanal darstellen und das reinzoomen in die Bilder abdrehen.
	
	//Image Picker erstellen. Delegate des ImagePicker ist mttViewController
	imagePicker = [[UIImagePickerController alloc] init];
	imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
	imagePicker.allowsEditing = NO;
	imagePicker.delegate = delegate;
	
	//PopoverController der den ImagePicker enthällt
    UIPopoverController *popOver = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
	[popOver presentPopoverFromRect:sender.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
	
	
	[imagePicker release];
	
}

- (IBAction)pushHelp:(UIButton *)sender {
	
	HelpViewController *helpView = [[HelpViewController alloc] initWithNibName:@"HelpView" bundle:[NSBundle mainBundle]];
	
	helpView.delegate = delegate;
	
	UINavigationController *helpNavController = [[UINavigationController alloc] initWithRootViewController:helpView];
	helpNavController.modalPresentationStyle = UIModalPresentationPageSheet;
	
	[delegate presentHelpView:helpNavController];
	
	[helpView release];
	[helpNavController release];

}

#pragma mark -
#pragma mark initialization & SysMethods

/*
 // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
        // Custom initialization
    }
    return self;
}
*/





/* Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    
	[super viewDidLoad];
	
}
*/

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Overriden to allow any orientation.
    return YES;
}


- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}


- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}


@end
